import Ajax from './ajax'

//发布文章
// {console.log({title, info, context,categoryID,tags})}
export const ReqPublicPassage = ({title, info, context,categoryID,tags}) => Ajax('/api/addPassage',{title, info, context,categoryID,tags},'POST')
// 删除图片
export const ReqDeleteImg = (name) => Ajax('/api/manage/img/delete',{name})
//请求所有分类的接口
export const ReqAllCategory = () => Ajax('/api/getCategory',{})
//修改分类的接口
export const ReqUpdataCategory = ({_id,newName}) => Ajax('/api/updateCategory',{_id,newName},'POST')
//添加分类的接口
export const ReqAddCategory = (categoryName) => Ajax('/api/addCategory',{categoryName},'POST')
//删除分类接口
export const ReqDeleteCategory = (_id) => Ajax('/api/deleteCategory',{_id},'POST')
//文章管理获取文章详情
export const ReqPassageDetail = (pageNum, pageSize) => Ajax('/api/passage_detail',{pageNum, pageSize},'POST')
// 获取分类名称 
export const ReqGetCategoryName = (_id) => Ajax('/api/queryCategoryName',{_id},'POST')
// 删除文章
export const ReqDeletePassage = (_id) => Ajax('/api/deletePassage',{_id},'POST')
// 请求文章的全部内容
export const ReqPassageAllContext = (_id) => Ajax('/api/passage_allcontext',{_id},'POST')
// 更新文章内容
export const ReqUpdatePassage = ({_id,title, info, context,categoryID,tags}) => Ajax('/api/UpdatePassage',{_id,title, info, context,categoryID,tags},'POST')
// 统计文章的发表数据
export const ReqPublicNumDaily = (cur_day) => Ajax('/api/PassagePublicSort',{cur_day})
// 登录
export const ReqLogin = (Mana_Name,Mana_PWD) => Ajax('/api/login',{Mana_Name,Mana_PWD},'POST') // 
// 自动登录 这个要修改axios的默认配置 因为post请求不会默认携带cookie,这个配置在main。js中设置
export const ReqAutoLogin = () => Ajax('/api/autoLogin',{},'POST')
// 获取驾校题目
export const ReqJiaKaoQues = (index) => Ajax('/api/jiaokaoquestions',{index})
// 请求题目总量
export const ReqQuestionNum = () => Ajax('/api/questionNum')